package com.example.demonstrate.wang.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static com.example.demonstrate.wang.constants.Constant.SEARCH_RATE_REQUEST_NUM;

/**
 * @Author along
 * @Date 2024/6/11 15:39
 */

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface RateLimited {
    int permits() default SEARCH_RATE_REQUEST_NUM; // 默认每秒5个请求，许可数为整数
}
